<html lang="en">

<head>

    <meta charset="UTF-8">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Document</title>
</head>

<body>
    
</body>
<script>
    var tizhong = prompt("请输入体重kg");
    var shengao = prompt("请输入身高m");
    var bmi = tizhong / (shengao * shengao);
    if (bmi >= 28) {
        alert("肥胖")
    } else if (bmi >= 24) {
        alert("超重")
    } else if (bmi >= 18.5) {
        alert("正常")
    } else if (bmi) {
        alert("消瘦")
    }
</script>

</html>